\hypertarget{group__can__api}{
\section{Can\_\-api}
\label{group__can__api}\index{Can\_\-api@{Can\_\-api}}
}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \hyperlink{structt_c_a_n_msg_object}{tCANMsgObject}
\item 
struct \hyperlink{structt_c_a_n_bit_clk_parms}{tCANBitClkParms}
\end{DoxyCompactItemize}
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group__can__api_gad1368e948556fa9ed4f74ecf8610845f}{
\#define {\bfseries CAN\_\-MAX\_\-11BIT\_\-MSG\_\-ID}~(0x7ff)}
\label{group__can__api_gad1368e948556fa9ed4f74ecf8610845f}

\item 
\hypertarget{group__can__api_gafb5b7c4d0f86cbd18852095fc37fd020}{
\#define {\bfseries CAN\_\-RW\_\-DELAY}~(5)}
\label{group__can__api_gafb5b7c4d0f86cbd18852095fc37fd020}

\item 
\hypertarget{group__can__api_ga54aec90dc979d14c3e3aad10d3284af3}{
\#define {\bfseries CAN\_\-MAX\_\-BIT\_\-DIVISOR}~(13)}
\label{group__can__api_ga54aec90dc979d14c3e3aad10d3284af3}

\item 
\hypertarget{group__can__api_ga57e5366b1956052d659f06990193c4c6}{
\#define {\bfseries CAN\_\-MIN\_\-BIT\_\-DIVISOR}~(5)}
\label{group__can__api_ga57e5366b1956052d659f06990193c4c6}

\item 
\hypertarget{group__can__api_ga5e034f57dcda85405e2ed9b4f36389da}{
\#define {\bfseries CAN\_\-MAX\_\-PRE\_\-DIVISOR}~(1024)}
\label{group__can__api_ga5e034f57dcda85405e2ed9b4f36389da}

\item 
\hypertarget{group__can__api_ga723a76d507997b3f6aae0a7052b42b16}{
\#define {\bfseries CAN\_\-MIN\_\-PRE\_\-DIVISOR}~(1)}
\label{group__can__api_ga723a76d507997b3f6aae0a7052b42b16}

\item 
\#define \hyperlink{group__can__api_ga72160bfa35ab86bf0e68c1e2c2dd67a2}{MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE}~0x00000001
\item 
\#define \hyperlink{group__can__api_ga8e611898e5a16c95b1e9ed517d84b463}{MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE}~0x00000002
\item 
\#define \hyperlink{group__can__api_ga9387d98cd6262e0be419aceab45295e4}{MSG\_\-OBJ\_\-EXTENDED\_\-ID}~0x00000004
\item 
\#define \hyperlink{group__can__api_gac8b622ceb867ab7de6f285ae630c534a}{MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER}~0x00000008
\item 
\hypertarget{group__can__api_ga3c0e245fe4dcf8cb1d987c6a4ff3fc0a}{
\#define \hyperlink{group__can__api_ga3c0e245fe4dcf8cb1d987c6a4ff3fc0a}{MSG\_\-OBJ\_\-NEW\_\-DATA}~0x00000080}
\label{group__can__api_ga3c0e245fe4dcf8cb1d987c6a4ff3fc0a}

\begin{DoxyCompactList}\small\item\em This indicates that new data was available in the message object. \item\end{DoxyCompactList}\item 
\#define \hyperlink{group__can__api_ga6405afc8e3cc146889ea8bc32bd0f0ca}{MSG\_\-OBJ\_\-DATA\_\-LOST}~0x00000100
\item 
\#define \hyperlink{group__can__api_gabd8bebbc78a6f49c3c3088c5c7d53ca9}{MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER}~(0x00000010 $|$ MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER)
\item 
\#define \hyperlink{group__can__api_gacead63b8e758f947f7aecf11d928e490}{MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER}~(0x00000020 $|$ MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER)
\item 
\hypertarget{group__can__api_gaba15117b85b019f6e907fcadd0333a8f}{
\#define \hyperlink{group__can__api_gaba15117b85b019f6e907fcadd0333a8f}{MSG\_\-OBJ\_\-REMOTE\_\-FRAME}~0x00000040}
\label{group__can__api_gaba15117b85b019f6e907fcadd0333a8f}

\begin{DoxyCompactList}\small\item\em This indicates that a message object is a remote frame. \item\end{DoxyCompactList}\item 
\#define \hyperlink{group__can__api_ga5e3141ec2c5c1130f5c8c0601ce9e614}{MSG\_\-OBJ\_\-FIFO}~0x00000200
\item 
\hypertarget{group__can__api_gac72c7dc1fe5ae5e73682f9602e9c92c7}{
\#define \hyperlink{group__can__api_gac72c7dc1fe5ae5e73682f9602e9c92c7}{MSG\_\-OBJ\_\-NO\_\-FLAGS}~0x00000000}
\label{group__can__api_gac72c7dc1fe5ae5e73682f9602e9c92c7}

\begin{DoxyCompactList}\small\item\em This indicates that a message object has no flags set. \item\end{DoxyCompactList}\item 
\#define \hyperlink{group__can__api_gac00ece1facc432a0454b9de2e35ad9ad}{MSG\_\-OBJ\_\-STATUS\_\-MASK}~(MSG\_\-OBJ\_\-NEW\_\-DATA $|$ MSG\_\-OBJ\_\-DATA\_\-LOST)
\item 
\#define \hyperlink{group__can__api_gaaeedfcc6f76b6f3edc4e389eb66969a7}{CAN\_\-INT\_\-ERROR}~0x00000008
\item 
\#define \hyperlink{group__can__api_ga9b574346c3ba9d87d77e39051c7361ef}{CAN\_\-INT\_\-STATUS}~0x00000004
\item 
\#define \hyperlink{group__can__api_ga7e4406f4eca9ad39d1062708d4afdcb0}{CAN\_\-INT\_\-MASTER}~0x00000002
\item 
\hypertarget{group__can__api_ga128af659ae92e97d117a488dbe31655c}{
\#define \hyperlink{group__can__api_ga128af659ae92e97d117a488dbe31655c}{CAN\_\-STATUS\_\-BUS\_\-OFF}~0x00000080}
\label{group__can__api_ga128af659ae92e97d117a488dbe31655c}

\begin{DoxyCompactList}\small\item\em CAN controller has entered a Bus Off state. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga598142e112fd7dcdf29227ddc3a18628}{
\#define \hyperlink{group__can__api_ga598142e112fd7dcdf29227ddc3a18628}{CAN\_\-STATUS\_\-EWARN}~0x00000040}
\label{group__can__api_ga598142e112fd7dcdf29227ddc3a18628}

\begin{DoxyCompactList}\small\item\em CAN controller error level has reached warning level. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga0ad72c583aeccf70ca41a458a4c4a418}{
\#define \hyperlink{group__can__api_ga0ad72c583aeccf70ca41a458a4c4a418}{CAN\_\-STATUS\_\-EPASS}~0x00000020}
\label{group__can__api_ga0ad72c583aeccf70ca41a458a4c4a418}

\begin{DoxyCompactList}\small\item\em CAN controller error level has reached error passive level. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga780dfd5173c3ca51be021325fcb301e6}{
\#define \hyperlink{group__can__api_ga780dfd5173c3ca51be021325fcb301e6}{CAN\_\-STATUS\_\-RXOK}~0x00000010}
\label{group__can__api_ga780dfd5173c3ca51be021325fcb301e6}

\begin{DoxyCompactList}\small\item\em A message was received successfully since the last read of this status. \item\end{DoxyCompactList}\item 
\#define \hyperlink{group__can__api_gae8a21b993556fac574a61c600c41d860}{CAN\_\-STATUS\_\-TXOK}~0x00000008
\item 
\hypertarget{group__can__api_ga09d4f385b401cb9e226b9f52d0c7c8ef}{
\#define \hyperlink{group__can__api_ga09d4f385b401cb9e226b9f52d0c7c8ef}{CAN\_\-STATUS\_\-LEC\_\-MSK}~0x00000007}
\label{group__can__api_ga09d4f385b401cb9e226b9f52d0c7c8ef}

\begin{DoxyCompactList}\small\item\em This is the mask for the last error code field. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga1b5513adc24698aa0e2c32d67d7c730f}{
\#define \hyperlink{group__can__api_ga1b5513adc24698aa0e2c32d67d7c730f}{CAN\_\-STATUS\_\-LEC\_\-NONE}~0x00000000}
\label{group__can__api_ga1b5513adc24698aa0e2c32d67d7c730f}

\begin{DoxyCompactList}\small\item\em There was no error. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga881c00803433a71131fcdae8bcd55fdc}{
\#define \hyperlink{group__can__api_ga881c00803433a71131fcdae8bcd55fdc}{CAN\_\-STATUS\_\-LEC\_\-STUFF}~0x00000001}
\label{group__can__api_ga881c00803433a71131fcdae8bcd55fdc}

\begin{DoxyCompactList}\small\item\em A bit stuffing error has occurred. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga09ffe0100093929da99dc790c0c1c155}{
\#define \hyperlink{group__can__api_ga09ffe0100093929da99dc790c0c1c155}{CAN\_\-STATUS\_\-LEC\_\-FORM}~0x00000002}
\label{group__can__api_ga09ffe0100093929da99dc790c0c1c155}

\begin{DoxyCompactList}\small\item\em A formatting error has occurred. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga09678c99a5e937f8af5ec659f2a2ea44}{
\#define \hyperlink{group__can__api_ga09678c99a5e937f8af5ec659f2a2ea44}{CAN\_\-STATUS\_\-LEC\_\-ACK}~0x00000003}
\label{group__can__api_ga09678c99a5e937f8af5ec659f2a2ea44}

\begin{DoxyCompactList}\small\item\em An acknowledge error has occurred. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga8a78754c15f75b6b422116055116e661}{
\#define \hyperlink{group__can__api_ga8a78754c15f75b6b422116055116e661}{CAN\_\-STATUS\_\-LEC\_\-BIT1}~0x00000004}
\label{group__can__api_ga8a78754c15f75b6b422116055116e661}

\begin{DoxyCompactList}\small\item\em The bus remained a bit level of 1 for longer than is allowed. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_gadb270e9f4ea428522ec8cef106160729}{
\#define \hyperlink{group__can__api_gadb270e9f4ea428522ec8cef106160729}{CAN\_\-STATUS\_\-LEC\_\-BIT0}~0x00000005}
\label{group__can__api_gadb270e9f4ea428522ec8cef106160729}

\begin{DoxyCompactList}\small\item\em The bus remained a bit level of 0 for longer than is allowed. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga8658d447348d87ecfd5c1386c48ee781}{
\#define \hyperlink{group__can__api_ga8658d447348d87ecfd5c1386c48ee781}{CAN\_\-STATUS\_\-LEC\_\-CRC}~0x00000006}
\label{group__can__api_ga8658d447348d87ecfd5c1386c48ee781}

\begin{DoxyCompactList}\small\item\em A CRC error has occurred. \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_gad5d011f8a4533a174f037e151a35cebe}{
\#define \hyperlink{group__can__api_gad5d011f8a4533a174f037e151a35cebe}{CAN\_\-STATUS\_\-LEC\_\-MASK}~0x00000007}
\label{group__can__api_gad5d011f8a4533a174f037e151a35cebe}

\begin{DoxyCompactList}\small\item\em This is the mask for the CAN Last Error Code (LEC). \item\end{DoxyCompactList}\item 
\hypertarget{group__can__api_ga08204cc7ba65ec3fd720e47fadd60559}{
\#define {\bfseries CANSetBitTiming}(a, b)~CANBitTimingSet(a, b)}
\label{group__can__api_ga08204cc7ba65ec3fd720e47fadd60559}

\item 
\hypertarget{group__can__api_ga449194e3e6419c901d077ccbe0021aec}{
\#define {\bfseries CANGetBitTiming}(a, b)~CANBitTimingGet(a, b)}
\label{group__can__api_ga449194e3e6419c901d077ccbe0021aec}

\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{group__can__api_ga73584383f566e98bf822b371a03becfc}{tCANIntStsReg} \{ \hyperlink{group__can__api_gga73584383f566e98bf822b371a03becfcaaab739e796c1216de72acf16410795a5}{CAN\_\-INT\_\-STS\_\-CAUSE}, 
\hyperlink{group__can__api_gga73584383f566e98bf822b371a03becfca8cb85391f55d762fcff16bb285903304}{CAN\_\-INT\_\-STS\_\-OBJECT}
 \}
\item 
enum \hyperlink{group__can__api_gad898b7c10eb4d9282bd4c25fc935b3d2}{tCANStsReg} \{ \hyperlink{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2aac2ece80a767774a99d1fb1e463aa932}{CAN\_\-STS\_\-CONTROL}, 
\hyperlink{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2afffa0c96b01a03aff5a5dd32c5aa77c7}{CAN\_\-STS\_\-TXREQUEST}, 
\hyperlink{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2afa63f81ede60a5209bc32c6eb94e7512}{CAN\_\-STS\_\-NEWDAT}, 
\hyperlink{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2a3fe016f4c8154bf2ef524621edfb293d}{CAN\_\-STS\_\-MSGVAL}
 \}
\item 
enum \hyperlink{group__can__api_gad3fa840d5e84a9366ba2a8c958c069a2}{tMsgObjType} \{ \par
\hyperlink{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2aa13483d5640bff99d693d271c2238230}{MSG\_\-OBJ\_\-TYPE\_\-TX}, 
\hyperlink{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a01289338e40c4573d4a78e6d40cab433}{MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE}, 
\hyperlink{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a19480934236e65a7090acd45caecb0a3}{MSG\_\-OBJ\_\-TYPE\_\-RX}, 
\hyperlink{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2ae268696d7605c98094e4136eb646a251}{MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE}, 
\par
\hyperlink{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a8aed86e235facdf4ab0ce8cb53de65c1}{MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE}
 \}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{group__can__api_gafc146acfa302f6225546625968101e4a}{CANInit} (unsigned long ulBase)
\item 
void \hyperlink{group__can__api_gab568cf0dd8c55af025822c05ab5a84f8}{CANEnable} (unsigned long ulBase)
\item 
void \hyperlink{group__can__api_gab5bfda045e8825f0035c9567ef80116c}{CANDisable} (unsigned long ulBase)
\item 
void \hyperlink{group__can__api_ga7e9835d09e6575ae9e69b9a0c8b87f06}{CANBitTimingGet} (unsigned long ulBase, \hyperlink{structt_c_a_n_bit_clk_parms}{tCANBitClkParms} $\ast$pClkParms)
\item 
unsigned long \hyperlink{group__can__api_gacb4de7845ae6819d6f1da641aa5c5aea}{CANBitRateSet} (unsigned long ulBase, unsigned long ulSourceClock, unsigned long ulBitRate)
\item 
void \hyperlink{group__can__api_ga1d29965d2d32c91e42ef5e9d6959715e}{CANBitTimingSet} (unsigned long ulBase, \hyperlink{structt_c_a_n_bit_clk_parms}{tCANBitClkParms} $\ast$pClkParms)
\item 
void \hyperlink{group__can__api_ga2bcb2deb8dcba265fc50922eb427ddf0}{CANIntRegister} (unsigned long ulBase, void($\ast$pfnHandler)(void))
\item 
void \hyperlink{group__can__api_ga41087b2bf0f7088c85cb4ea0ca583169}{CANIntUnregister} (unsigned long ulBase)
\item 
void \hyperlink{group__can__api_ga28605d111974c9d4f15729adde8b0040}{CANIntEnable} (unsigned long ulBase, unsigned long ulIntFlags)
\item 
void \hyperlink{group__can__api_ga331d57cd0ca1d2dca842a39a0e3876b4}{CANIntDisable} (unsigned long ulBase, unsigned long ulIntFlags)
\item 
unsigned long \hyperlink{group__can__api_gaad94863ee9297b27bd3635106644c47b}{CANIntStatus} (unsigned long ulBase, \hyperlink{group__can__api_ga73584383f566e98bf822b371a03becfc}{tCANIntStsReg} eIntStsReg)
\item 
void \hyperlink{group__can__api_ga367aeec82c3adb97ca1e8c1278de8c50}{CANIntClear} (unsigned long ulBase, unsigned long ulIntClr)
\item 
void \hyperlink{group__can__api_ga2edf1770a8e6cafd206068dee0a33c92}{CANRetrySet} (unsigned long ulBase, tBoolean bAutoRetry)
\item 
tBoolean \hyperlink{group__can__api_ga3693ab778af480c2d3089db6a551d558}{CANRetryGet} (unsigned long ulBase)
\item 
unsigned long \hyperlink{group__can__api_ga9c212852faa05bed58d45af52e49b3fc}{CANStatusGet} (unsigned long ulBase, \hyperlink{group__can__api_gad898b7c10eb4d9282bd4c25fc935b3d2}{tCANStsReg} eStatusReg)
\item 
tBoolean \hyperlink{group__can__api_ga5d5df98d19b0587c534148ecd0666ca5}{CANErrCntrGet} (unsigned long ulBase, unsigned long $\ast$pulRxCount, unsigned long $\ast$pulTxCount)
\item 
void \hyperlink{group__can__api_ga89c4fad5a3fcaf63d551312d4bd6559c}{CANMessageSet} (unsigned long ulBase, unsigned long ulObjID, \hyperlink{structt_c_a_n_msg_object}{tCANMsgObject} $\ast$pMsgObject, \hyperlink{group__can__api_gad3fa840d5e84a9366ba2a8c958c069a2}{tMsgObjType} eMsgType)
\item 
void \hyperlink{group__can__api_ga0bdccdf3bb7f81c0a83150c37627be2a}{CANMessageGet} (unsigned long ulBase, unsigned long ulObjID, \hyperlink{structt_c_a_n_msg_object}{tCANMsgObject} $\ast$pMsgObject, tBoolean bClrPendingInt)
\item 
void \hyperlink{group__can__api_ga969a73040127206e121190d71385d538}{CANMessageClear} (unsigned long ulBase, unsigned long ulObjID)
\end{DoxyCompactItemize}


\subsection{Define Documentation}
\hypertarget{group__can__api_gaaeedfcc6f76b6f3edc4e389eb66969a7}{
\index{can\_\-api@{can\_\-api}!CAN\_\-INT\_\-ERROR@{CAN\_\-INT\_\-ERROR}}
\index{CAN\_\-INT\_\-ERROR@{CAN\_\-INT\_\-ERROR}!can_api@{can\_\-api}}
\subsubsection[{CAN\_\-INT\_\-ERROR}]{\setlength{\rightskip}{0pt plus 5cm}\#define CAN\_\-INT\_\-ERROR~0x00000008}}
\label{group__can__api_gaaeedfcc6f76b6f3edc4e389eb66969a7}
This flag is used to allow a CAN controller to generate error interrupts. \hypertarget{group__can__api_ga7e4406f4eca9ad39d1062708d4afdcb0}{
\index{can\_\-api@{can\_\-api}!CAN\_\-INT\_\-MASTER@{CAN\_\-INT\_\-MASTER}}
\index{CAN\_\-INT\_\-MASTER@{CAN\_\-INT\_\-MASTER}!can_api@{can\_\-api}}
\subsubsection[{CAN\_\-INT\_\-MASTER}]{\setlength{\rightskip}{0pt plus 5cm}\#define CAN\_\-INT\_\-MASTER~0x00000002}}
\label{group__can__api_ga7e4406f4eca9ad39d1062708d4afdcb0}
This flag is used to allow a CAN controller to generate any CAN interrupts. If this is not set, then no interrupts will be generated by the CAN controller. \hypertarget{group__can__api_ga9b574346c3ba9d87d77e39051c7361ef}{
\index{can\_\-api@{can\_\-api}!CAN\_\-INT\_\-STATUS@{CAN\_\-INT\_\-STATUS}}
\index{CAN\_\-INT\_\-STATUS@{CAN\_\-INT\_\-STATUS}!can_api@{can\_\-api}}
\subsubsection[{CAN\_\-INT\_\-STATUS}]{\setlength{\rightskip}{0pt plus 5cm}\#define CAN\_\-INT\_\-STATUS~0x00000004}}
\label{group__can__api_ga9b574346c3ba9d87d77e39051c7361ef}
This flag is used to allow a CAN controller to generate status interrupts. \hypertarget{group__can__api_gae8a21b993556fac574a61c600c41d860}{
\index{can\_\-api@{can\_\-api}!CAN\_\-STATUS\_\-TXOK@{CAN\_\-STATUS\_\-TXOK}}
\index{CAN\_\-STATUS\_\-TXOK@{CAN\_\-STATUS\_\-TXOK}!can_api@{can\_\-api}}
\subsubsection[{CAN\_\-STATUS\_\-TXOK}]{\setlength{\rightskip}{0pt plus 5cm}\#define CAN\_\-STATUS\_\-TXOK~0x00000008}}
\label{group__can__api_gae8a21b993556fac574a61c600c41d860}
A message was transmitted successfully since the last read of this status. \hypertarget{group__can__api_ga6405afc8e3cc146889ea8bc32bd0f0ca}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-DATA\_\-LOST@{MSG\_\-OBJ\_\-DATA\_\-LOST}}
\index{MSG\_\-OBJ\_\-DATA\_\-LOST@{MSG\_\-OBJ\_\-DATA\_\-LOST}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-DATA\_\-LOST}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-DATA\_\-LOST~0x00000100}}
\label{group__can__api_ga6405afc8e3cc146889ea8bc32bd0f0ca}
This indicates that data was lost since this message object was last read. \hypertarget{group__can__api_ga9387d98cd6262e0be419aceab45295e4}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-EXTENDED\_\-ID@{MSG\_\-OBJ\_\-EXTENDED\_\-ID}}
\index{MSG\_\-OBJ\_\-EXTENDED\_\-ID@{MSG\_\-OBJ\_\-EXTENDED\_\-ID}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-EXTENDED\_\-ID}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-EXTENDED\_\-ID~0x00000004}}
\label{group__can__api_ga9387d98cd6262e0be419aceab45295e4}
This indicates that a message object will use or is using an extended identifier. \hypertarget{group__can__api_ga5e3141ec2c5c1130f5c8c0601ce9e614}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-FIFO@{MSG\_\-OBJ\_\-FIFO}}
\index{MSG\_\-OBJ\_\-FIFO@{MSG\_\-OBJ\_\-FIFO}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-FIFO}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-FIFO~0x00000200}}
\label{group__can__api_ga5e3141ec2c5c1130f5c8c0601ce9e614}
This indicates that this message object is part of a FIFO structure and not the final message object in a FIFO. \hypertarget{group__can__api_ga8e611898e5a16c95b1e9ed517d84b463}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE@{MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE}}
\index{MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE@{MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE~0x00000002}}
\label{group__can__api_ga8e611898e5a16c95b1e9ed517d84b463}
This indicates that receive interrupts should be enabled, or are enabled. \hypertarget{group__can__api_gac00ece1facc432a0454b9de2e35ad9ad}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-STATUS\_\-MASK@{MSG\_\-OBJ\_\-STATUS\_\-MASK}}
\index{MSG\_\-OBJ\_\-STATUS\_\-MASK@{MSG\_\-OBJ\_\-STATUS\_\-MASK}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-STATUS\_\-MASK}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-STATUS\_\-MASK~(MSG\_\-OBJ\_\-NEW\_\-DATA $|$ MSG\_\-OBJ\_\-DATA\_\-LOST)}}
\label{group__can__api_gac00ece1facc432a0454b9de2e35ad9ad}
This define is used with the flag values to allow checking only status flags and not configuration flags. \hypertarget{group__can__api_ga72160bfa35ab86bf0e68c1e2c2dd67a2}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE@{MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE}}
\index{MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE@{MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE~0x00000001}}
\label{group__can__api_ga72160bfa35ab86bf0e68c1e2c2dd67a2}
This definition is used with the \hyperlink{structt_c_a_n_msg_object}{tCANMsgObject} ulFlags value and indicates that transmit interrupts should be enabled, or are enabled. \hypertarget{group__can__api_gabd8bebbc78a6f49c3c3088c5c7d53ca9}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER@{MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER}}
\index{MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER@{MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-USE\_\-DIR\_\-FILTER~(0x00000010 $|$ MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER)}}
\label{group__can__api_gabd8bebbc78a6f49c3c3088c5c7d53ca9}
This indicates that a message object will use or is using filtering based on the direction of the transfer. If the direction filtering is used, then ID filtering must also be enabled. \hypertarget{group__can__api_gacead63b8e758f947f7aecf11d928e490}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER@{MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER}}
\index{MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER@{MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-USE\_\-EXT\_\-FILTER~(0x00000020 $|$ MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER)}}
\label{group__can__api_gacead63b8e758f947f7aecf11d928e490}
This indicates that a message object will use or is using message identifier filtering based on the extended identifier. If the extended identifier filtering is used, then ID filtering must also be enabled. \hypertarget{group__can__api_gac8b622ceb867ab7de6f285ae630c534a}{
\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER@{MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER}}
\index{MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER@{MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER}!can_api@{can\_\-api}}
\subsubsection[{MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER}]{\setlength{\rightskip}{0pt plus 5cm}\#define MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER~0x00000008}}
\label{group__can__api_gac8b622ceb867ab7de6f285ae630c534a}
This indicates that a message object will use or is using filtering based on the object's message identifier. 

\subsection{Enumeration Type Documentation}
\hypertarget{group__can__api_ga73584383f566e98bf822b371a03becfc}{
\index{can\_\-api@{can\_\-api}!tCANIntStsReg@{tCANIntStsReg}}
\index{tCANIntStsReg@{tCANIntStsReg}!can_api@{can\_\-api}}
\subsubsection[{tCANIntStsReg}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf tCANIntStsReg}}}
\label{group__can__api_ga73584383f566e98bf822b371a03becfc}
This data type is used to identify the interrupt status register. This is used when calling the \hyperlink{group__can__api_gaad94863ee9297b27bd3635106644c47b}{CANIntStatus()} function. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{CAN\_\-INT\_\-STS\_\-CAUSE@{CAN\_\-INT\_\-STS\_\-CAUSE}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!CAN\_\-INT\_\-STS\_\-CAUSE@{CAN\_\-INT\_\-STS\_\-CAUSE}}\item[{\em 
\hypertarget{group__can__api_gga73584383f566e98bf822b371a03becfcaaab739e796c1216de72acf16410795a5}{
CAN\_\-INT\_\-STS\_\-CAUSE}
\label{group__can__api_gga73584383f566e98bf822b371a03becfcaaab739e796c1216de72acf16410795a5}
}]Read the CAN interrupt status information. \index{CAN\_\-INT\_\-STS\_\-OBJECT@{CAN\_\-INT\_\-STS\_\-OBJECT}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!CAN\_\-INT\_\-STS\_\-OBJECT@{CAN\_\-INT\_\-STS\_\-OBJECT}}\item[{\em 
\hypertarget{group__can__api_gga73584383f566e98bf822b371a03becfca8cb85391f55d762fcff16bb285903304}{
CAN\_\-INT\_\-STS\_\-OBJECT}
\label{group__can__api_gga73584383f566e98bf822b371a03becfca8cb85391f55d762fcff16bb285903304}
}]Read a message object's interrupt status. \end{description}
\end{Desc}

\hypertarget{group__can__api_gad898b7c10eb4d9282bd4c25fc935b3d2}{
\index{can\_\-api@{can\_\-api}!tCANStsReg@{tCANStsReg}}
\index{tCANStsReg@{tCANStsReg}!can_api@{can\_\-api}}
\subsubsection[{tCANStsReg}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf tCANStsReg}}}
\label{group__can__api_gad898b7c10eb4d9282bd4c25fc935b3d2}
This data type is used to identify which of several status registers to read when calling the \hyperlink{group__can__api_ga9c212852faa05bed58d45af52e49b3fc}{CANStatusGet()} function. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{CAN\_\-STS\_\-CONTROL@{CAN\_\-STS\_\-CONTROL}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!CAN\_\-STS\_\-CONTROL@{CAN\_\-STS\_\-CONTROL}}\item[{\em 
\hypertarget{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2aac2ece80a767774a99d1fb1e463aa932}{
CAN\_\-STS\_\-CONTROL}
\label{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2aac2ece80a767774a99d1fb1e463aa932}
}]Read the full CAN controller status. \index{CAN\_\-STS\_\-TXREQUEST@{CAN\_\-STS\_\-TXREQUEST}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!CAN\_\-STS\_\-TXREQUEST@{CAN\_\-STS\_\-TXREQUEST}}\item[{\em 
\hypertarget{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2afffa0c96b01a03aff5a5dd32c5aa77c7}{
CAN\_\-STS\_\-TXREQUEST}
\label{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2afffa0c96b01a03aff5a5dd32c5aa77c7}
}]Read the full 32-\/bit mask of message objects with a transmit request set. \index{CAN\_\-STS\_\-NEWDAT@{CAN\_\-STS\_\-NEWDAT}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!CAN\_\-STS\_\-NEWDAT@{CAN\_\-STS\_\-NEWDAT}}\item[{\em 
\hypertarget{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2afa63f81ede60a5209bc32c6eb94e7512}{
CAN\_\-STS\_\-NEWDAT}
\label{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2afa63f81ede60a5209bc32c6eb94e7512}
}]Read the full 32-\/bit mask of message objects with new data available. \index{CAN\_\-STS\_\-MSGVAL@{CAN\_\-STS\_\-MSGVAL}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!CAN\_\-STS\_\-MSGVAL@{CAN\_\-STS\_\-MSGVAL}}\item[{\em 
\hypertarget{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2a3fe016f4c8154bf2ef524621edfb293d}{
CAN\_\-STS\_\-MSGVAL}
\label{group__can__api_ggad898b7c10eb4d9282bd4c25fc935b3d2a3fe016f4c8154bf2ef524621edfb293d}
}]Read the full 32-\/bit mask of message objects that are enabled. \end{description}
\end{Desc}

\hypertarget{group__can__api_gad3fa840d5e84a9366ba2a8c958c069a2}{
\index{can\_\-api@{can\_\-api}!tMsgObjType@{tMsgObjType}}
\index{tMsgObjType@{tMsgObjType}!can_api@{can\_\-api}}
\subsubsection[{tMsgObjType}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf tMsgObjType}}}
\label{group__can__api_gad3fa840d5e84a9366ba2a8c958c069a2}
This definition is used to determine the type of message object that will be set up via a call to the \hyperlink{group__can__api_ga89c4fad5a3fcaf63d551312d4bd6559c}{CANMessageSet()} API. \begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{MSG\_\-OBJ\_\-TYPE\_\-TX@{MSG\_\-OBJ\_\-TYPE\_\-TX}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-TYPE\_\-TX@{MSG\_\-OBJ\_\-TYPE\_\-TX}}\item[{\em 
\hypertarget{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2aa13483d5640bff99d693d271c2238230}{
MSG\_\-OBJ\_\-TYPE\_\-TX}
\label{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2aa13483d5640bff99d693d271c2238230}
}]Transmit message object. \index{MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE@{MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE@{MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE}}\item[{\em 
\hypertarget{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a01289338e40c4573d4a78e6d40cab433}{
MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE}
\label{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a01289338e40c4573d4a78e6d40cab433}
}]Transmit remote request message object. \index{MSG\_\-OBJ\_\-TYPE\_\-RX@{MSG\_\-OBJ\_\-TYPE\_\-RX}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-TYPE\_\-RX@{MSG\_\-OBJ\_\-TYPE\_\-RX}}\item[{\em 
\hypertarget{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a19480934236e65a7090acd45caecb0a3}{
MSG\_\-OBJ\_\-TYPE\_\-RX}
\label{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a19480934236e65a7090acd45caecb0a3}
}]Receive message object. \index{MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE@{MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE@{MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE}}\item[{\em 
\hypertarget{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2ae268696d7605c98094e4136eb646a251}{
MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE}
\label{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2ae268696d7605c98094e4136eb646a251}
}]Receive remote request message object. \index{MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE@{MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE}!can\_\-api@{can\_\-api}}\index{can\_\-api@{can\_\-api}!MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE@{MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE}}\item[{\em 
\hypertarget{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a8aed86e235facdf4ab0ce8cb53de65c1}{
MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE}
\label{group__can__api_ggad3fa840d5e84a9366ba2a8c958c069a2a8aed86e235facdf4ab0ce8cb53de65c1}
}]Remote frame receive remote, with auto-\/transmit message object. \end{description}
\end{Desc}



\subsection{Function Documentation}
\hypertarget{group__can__api_gacb4de7845ae6819d6f1da641aa5c5aea}{
\index{can\_\-api@{can\_\-api}!CANBitRateSet@{CANBitRateSet}}
\index{CANBitRateSet@{CANBitRateSet}!can_api@{can\_\-api}}
\subsubsection[{CANBitRateSet}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long CANBitRateSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulSourceClock, }
\item[{unsigned long}]{ ulBitRate}
\end{DoxyParamCaption}
)}}
\label{group__can__api_gacb4de7845ae6819d6f1da641aa5c5aea}
This function is used to set the CAN bit timing values to a nominal setting based on a desired bit rate.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulSourceClock}]is the system clock for the device in Hz. \item[{\em ulBitRate}]is the desired bit rate.\end{DoxyParams}
This function will set the CAN bit timing for the bit rate passed in the {\itshape ulBitRate\/} parameter based on the {\itshape ulSourceClock\/} parameter. Since the CAN clock is based off of the system clock the calling function should pass in the source clock rate either by retrieving it from \hyperlink{group__sysctl__api_ga7fd64f17ef7b589c51d72df5837f13eb}{SysCtlClockGet()} or using a specific value in Hz. The CAN bit clock is calculated to be an average timing value that should work for most systems. If tighter timing requirements are needed, then the \hyperlink{group__can__api_ga1d29965d2d32c91e42ef5e9d6959715e}{CANBitTimingSet()} function is available for full customization of all of the CAN bit timing values. Since not all bit rates can be matched exactly, the bit rate is set to the value closest to the desired bit rate without being higher than the {\itshape ulBitRate\/} value.

\begin{DoxyNote}{Note}
On some devices the source clock is fixed at 8MHz so the {\itshape ulSourceClock\/} should be set to 8000000.
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
This function returns the bit rate that the CAN controller was configured to use or it returns 0 to indicate that the bit rate was not changed because the requested bit rate was not valid. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga7e9835d09e6575ae9e69b9a0c8b87f06}{
\index{can\_\-api@{can\_\-api}!CANBitTimingGet@{CANBitTimingGet}}
\index{CANBitTimingGet@{CANBitTimingGet}!can_api@{can\_\-api}}
\subsubsection[{CANBitTimingGet}]{\setlength{\rightskip}{0pt plus 5cm}void CANBitTimingGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{{\bf tCANBitClkParms} $\ast$}]{ pClkParms}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga7e9835d09e6575ae9e69b9a0c8b87f06}
Reads the current settings for the CAN controller bit timing.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em pClkParms}]is a pointer to a structure to hold the timing parameters.\end{DoxyParams}
This function reads the current configuration of the CAN controller bit clock timing, and stores the resulting information in the structure supplied by the caller. Refer to \hyperlink{group__can__api_ga1d29965d2d32c91e42ef5e9d6959715e}{CANBitTimingSet()} for the meaning of the values that are returned in the structure pointed to by {\itshape pClkParms\/}.

This function replaces the original CANGetBitTiming() API and performs the same actions. A macro is provided in {\ttfamily \hyperlink{can_8h_source}{can.h}} to map the original API to this API.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga1d29965d2d32c91e42ef5e9d6959715e}{
\index{can\_\-api@{can\_\-api}!CANBitTimingSet@{CANBitTimingSet}}
\index{CANBitTimingSet@{CANBitTimingSet}!can_api@{can\_\-api}}
\subsubsection[{CANBitTimingSet}]{\setlength{\rightskip}{0pt plus 5cm}void CANBitTimingSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{{\bf tCANBitClkParms} $\ast$}]{ pClkParms}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga1d29965d2d32c91e42ef5e9d6959715e}
Configures the CAN controller bit timing.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em pClkParms}]points to the structure with the clock parameters.\end{DoxyParams}
Configures the various timing parameters for the CAN bus bit timing: Propagation segment, Phase Buffer 1 segment, Phase Buffer 2 segment, and the Synchronization Jump Width. The values for Propagation and Phase Buffer 1 segments are derived from the combination {\itshape pClkParms-\/$>$uSyncPropPhase1Seg\/} parameter. Phase Buffer 2 is determined from the {\itshape pClkParms-\/$>$uPhase2Seg\/} parameter. These two parameters, along with {\itshape pClkParms-\/$>$uSJW\/} are based in units of bit time quanta. The actual quantum time is determined by the {\itshape pClkParms-\/$>$uQuantumPrescaler\/} value, which specifies the divisor for the CAN module clock.

The total bit time, in quanta, will be the sum of the two Seg parameters, as follows:

bit\_\-time\_\-q = uSyncPropPhase1Seg + uPhase2Seg + 1

Note that the Sync\_\-Seg is always one quantum in duration, and will be added to derive the correct duration of Prop\_\-Seg and Phase1\_\-Seg.

The equation to determine the actual bit rate is as follows:

CAN Clock / (({\itshape uSyncPropPhase1Seg\/} + {\itshape uPhase2Seg\/} + 1) $\ast$ ({\itshape uQuantumPrescaler\/}))

This means that with {\itshape uSyncPropPhase1Seg\/} = 4, {\itshape uPhase2Seg\/} = 1, {\itshape uQuantumPrescaler\/} = 2 and an 8 MHz CAN clock, that the bit rate will be (8 MHz) / ((5 + 2 + 1) $\ast$ 2) or 500 Kbit/sec.

This function replaces the original CANSetBitTiming() API and performs the same actions. A macro is provided in {\ttfamily \hyperlink{can_8h_source}{can.h}} to map the original API to this API.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_gab5bfda045e8825f0035c9567ef80116c}{
\index{can\_\-api@{can\_\-api}!CANDisable@{CANDisable}}
\index{CANDisable@{CANDisable}!can_api@{can\_\-api}}
\subsubsection[{CANDisable}]{\setlength{\rightskip}{0pt plus 5cm}void CANDisable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__can__api_gab5bfda045e8825f0035c9567ef80116c}
Disables the CAN controller.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller to disable.\end{DoxyParams}
Disables the CAN controller for message processing. When disabled, the controller will no longer automatically process data on the CAN bus. The controller can be restarted by calling \hyperlink{group__can__api_gab568cf0dd8c55af025822c05ab5a84f8}{CANEnable()}. The state of the CAN controller and the message objects in the controller are left as they were before this call was made.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_gab568cf0dd8c55af025822c05ab5a84f8}{
\index{can\_\-api@{can\_\-api}!CANEnable@{CANEnable}}
\index{CANEnable@{CANEnable}!can_api@{can\_\-api}}
\subsubsection[{CANEnable}]{\setlength{\rightskip}{0pt plus 5cm}void CANEnable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__can__api_gab568cf0dd8c55af025822c05ab5a84f8}
Enables the CAN controller.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller to enable.\end{DoxyParams}
Enables the CAN controller for message processing. Once enabled, the controller will automatically transmit any pending frames, and process any received frames. The controller can be stopped by calling \hyperlink{group__can__api_gab5bfda045e8825f0035c9567ef80116c}{CANDisable()}. Prior to calling \hyperlink{group__can__api_gab568cf0dd8c55af025822c05ab5a84f8}{CANEnable()}, \hyperlink{group__can__api_gafc146acfa302f6225546625968101e4a}{CANInit()} should have been called to initialize the controller and the CAN bus clock should be configured by calling \hyperlink{group__can__api_ga1d29965d2d32c91e42ef5e9d6959715e}{CANBitTimingSet()}.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga5d5df98d19b0587c534148ecd0666ca5}{
\index{can\_\-api@{can\_\-api}!CANErrCntrGet@{CANErrCntrGet}}
\index{CANErrCntrGet@{CANErrCntrGet}!can_api@{can\_\-api}}
\subsubsection[{CANErrCntrGet}]{\setlength{\rightskip}{0pt plus 5cm}tBoolean CANErrCntrGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long $\ast$}]{ pulRxCount, }
\item[{unsigned long $\ast$}]{ pulTxCount}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga5d5df98d19b0587c534148ecd0666ca5}
Reads the CAN controller error counter register.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em pulRxCount}]is a pointer to storage for the receive error counter. \item[{\em pulTxCount}]is a pointer to storage for the transmit error counter.\end{DoxyParams}
Reads the error counter register and returns the transmit and receive error counts to the caller along with a flag indicating if the controller receive counter has reached the error passive limit. The values of the receive and transmit error counters are returned through the pointers provided as parameters.

After this call, {\itshape $\ast$pulRxCount\/} will hold the current receive error count and {\itshape $\ast$pulTxCount\/} will hold the current transmit error count.

\begin{DoxyReturn}{Returns}
Returns {\bfseries true} if the receive error count has reached the error passive limit, and {\bfseries false} if the error count is below the error passive limit. 
\end{DoxyReturn}
\hypertarget{group__can__api_gafc146acfa302f6225546625968101e4a}{
\index{can\_\-api@{can\_\-api}!CANInit@{CANInit}}
\index{CANInit@{CANInit}!can_api@{can\_\-api}}
\subsubsection[{CANInit}]{\setlength{\rightskip}{0pt plus 5cm}void CANInit (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__can__api_gafc146acfa302f6225546625968101e4a}
Initializes the CAN controller after reset.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller.\end{DoxyParams}
After reset, the CAN controller is left in the disabled state. However, the memory used for message objects contains undefined values and must be cleared prior to enabling the CAN controller the first time. This prevents unwanted transmission or reception of data before the message objects are configured. This function must be called before enabling the controller the first time.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga367aeec82c3adb97ca1e8c1278de8c50}{
\index{can\_\-api@{can\_\-api}!CANIntClear@{CANIntClear}}
\index{CANIntClear@{CANIntClear}!can_api@{can\_\-api}}
\subsubsection[{CANIntClear}]{\setlength{\rightskip}{0pt plus 5cm}void CANIntClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulIntClr}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga367aeec82c3adb97ca1e8c1278de8c50}
Clears a CAN interrupt source.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulIntClr}]is a value indicating which interrupt source to clear.\end{DoxyParams}
This function can be used to clear a specific interrupt source. The {\itshape ulIntClr\/} parameter should be one of the following values:


\begin{DoxyItemize}
\item {\bfseries CAN\_\-INT\_\-INTID\_\-STATUS} -\/ Clears a status interrupt.
\item 1-\/32 -\/ Clears the specified message object interrupt
\end{DoxyItemize}

It is not necessary to use this function to clear an interrupt. This should only be used if the application wants to clear an interrupt source without taking the normal interrupt action.

Normally, the status interrupt is cleared by reading the controller status using \hyperlink{group__can__api_ga9c212852faa05bed58d45af52e49b3fc}{CANStatusGet()}. A specific message object interrupt is normally cleared by reading the message object using \hyperlink{group__can__api_ga0bdccdf3bb7f81c0a83150c37627be2a}{CANMessageGet()}.

\begin{DoxyNote}{Note}
Since there is a write buffer in the Cortex-\/M3 processor, it may take several clock cycles before the interrupt source is actually cleared. Therefore, it is recommended that the interrupt source be cleared early in the interrupt handler (as opposed to the very last action) to avoid returning from the interrupt handler before the interrupt source is actually cleared. Failure to do so may result in the interrupt handler being immediately reentered (since NVIC still sees the interrupt source asserted).
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga331d57cd0ca1d2dca842a39a0e3876b4}{
\index{can\_\-api@{can\_\-api}!CANIntDisable@{CANIntDisable}}
\index{CANIntDisable@{CANIntDisable}!can_api@{can\_\-api}}
\subsubsection[{CANIntDisable}]{\setlength{\rightskip}{0pt plus 5cm}void CANIntDisable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulIntFlags}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga331d57cd0ca1d2dca842a39a0e3876b4}
Disables individual CAN controller interrupt sources.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulIntFlags}]is the bit mask of the interrupt sources to be disabled.\end{DoxyParams}
Disables the specified CAN controller interrupt sources. Only enabled interrupt sources can cause a processor interrupt.

The {\itshape ulIntFlags\/} parameter has the same definition as in the \hyperlink{group__can__api_ga28605d111974c9d4f15729adde8b0040}{CANIntEnable()} function.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga28605d111974c9d4f15729adde8b0040}{
\index{can\_\-api@{can\_\-api}!CANIntEnable@{CANIntEnable}}
\index{CANIntEnable@{CANIntEnable}!can_api@{can\_\-api}}
\subsubsection[{CANIntEnable}]{\setlength{\rightskip}{0pt plus 5cm}void CANIntEnable (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulIntFlags}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga28605d111974c9d4f15729adde8b0040}
Enables individual CAN controller interrupt sources.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulIntFlags}]is the bit mask of the interrupt sources to be enabled.\end{DoxyParams}
Enables specific interrupt sources of the CAN controller. Only enabled sources will cause a processor interrupt.

The {\itshape ulIntFlags\/} parameter is the logical OR of any of the following:


\begin{DoxyItemize}
\item {\bfseries CAN\_\-INT\_\-ERROR} -\/ a controller error condition has occurred
\item {\bfseries CAN\_\-INT\_\-STATUS} -\/ a message transfer has completed, or a bus error has been detected
\item {\bfseries CAN\_\-INT\_\-MASTER} -\/ allow CAN controller to generate interrupts
\end{DoxyItemize}

In order to generate any interrupts, {\bfseries CAN\_\-INT\_\-MASTER} must be enabled. Further, for any particular transaction from a message object to generate an interrupt, that message object must have interrupts enabled (see \hyperlink{group__can__api_ga89c4fad5a3fcaf63d551312d4bd6559c}{CANMessageSet()}). {\bfseries CAN\_\-INT\_\-ERROR} will generate an interrupt if the controller enters the ``bus off'' condition, or if the error counters reach a limit. {\bfseries CAN\_\-INT\_\-STATUS} will generate an interrupt under quite a few status conditions and may provide more interrupts than the application needs to handle. When an interrupt occurs, use \hyperlink{group__can__api_gaad94863ee9297b27bd3635106644c47b}{CANIntStatus()} to determine the cause.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga2bcb2deb8dcba265fc50922eb427ddf0}{
\index{can\_\-api@{can\_\-api}!CANIntRegister@{CANIntRegister}}
\index{CANIntRegister@{CANIntRegister}!can_api@{can\_\-api}}
\subsubsection[{CANIntRegister}]{\setlength{\rightskip}{0pt plus 5cm}void CANIntRegister (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{void($\ast$)(void)}]{ pfnHandler}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga2bcb2deb8dcba265fc50922eb427ddf0}
Registers an interrupt handler for the CAN controller.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em pfnHandler}]is a pointer to the function to be called when the enabled CAN interrupts occur.\end{DoxyParams}
This function registers the interrupt handler in the interrupt vector table, and enables CAN interrupts on the interrupt controller; specific CAN interrupt sources must be enabled using \hyperlink{group__can__api_ga28605d111974c9d4f15729adde8b0040}{CANIntEnable()}. The interrupt handler being registered must clear the source of the interrupt using \hyperlink{group__can__api_ga367aeec82c3adb97ca1e8c1278de8c50}{CANIntClear()}.

If the application is using a static interrupt vector table stored in flash, then it is not necessary to register the interrupt handler this way. Instead, \hyperlink{group__interrupt__api_gaa17d17172b0304d0dc0596d7a0c86173}{IntEnable()} should be used to enable CAN interrupts on the interrupt controller.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{IntRegister()} for important information about registering interrupt handlers.
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_gaad94863ee9297b27bd3635106644c47b}{
\index{can\_\-api@{can\_\-api}!CANIntStatus@{CANIntStatus}}
\index{CANIntStatus@{CANIntStatus}!can_api@{can\_\-api}}
\subsubsection[{CANIntStatus}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long CANIntStatus (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{{\bf tCANIntStsReg}}]{ eIntStsReg}
\end{DoxyParamCaption}
)}}
\label{group__can__api_gaad94863ee9297b27bd3635106644c47b}
Returns the current CAN controller interrupt status.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em eIntStsReg}]indicates which interrupt status register to read\end{DoxyParams}
Returns the value of one of two interrupt status registers. The interrupt status register read is determined by the {\itshape eIntStsReg\/} parameter, which can have one of the following values:


\begin{DoxyItemize}
\item {\bfseries CAN\_\-INT\_\-STS\_\-CAUSE} -\/ indicates the cause of the interrupt
\item {\bfseries CAN\_\-INT\_\-STS\_\-OBJECT} -\/ indicates pending interrupts of all message objects
\end{DoxyItemize}

{\bfseries CAN\_\-INT\_\-STS\_\-CAUSE} returns the value of the controller interrupt register and indicates the cause of the interrupt. It will be a value of {\bfseries CAN\_\-INT\_\-INTID\_\-STATUS} if the cause is a status interrupt. In this case, the status register should be read with the \hyperlink{group__can__api_ga9c212852faa05bed58d45af52e49b3fc}{CANStatusGet()} function. Calling this function to read the status will also clear the status interrupt. If the value of the interrupt register is in the range 1-\/32, then this indicates the number of the highest priority message object that has an interrupt pending. The message object interrupt can be cleared by using the \hyperlink{group__can__api_ga367aeec82c3adb97ca1e8c1278de8c50}{CANIntClear()} function, or by reading the message using \hyperlink{group__can__api_ga0bdccdf3bb7f81c0a83150c37627be2a}{CANMessageGet()} in the case of a received message. The interrupt handler can read the interrupt status again to make sure all pending interrupts are cleared before returning from the interrupt.

{\bfseries CAN\_\-INT\_\-STS\_\-OBJECT} returns a bit mask indicating which message objects have pending interrupts. This can be used to discover all of the pending interrupts at once, as opposed to repeatedly reading the interrupt register by using {\bfseries CAN\_\-INT\_\-STS\_\-CAUSE}.

\begin{DoxyReturn}{Returns}
Returns the value of one of the interrupt status registers. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga41087b2bf0f7088c85cb4ea0ca583169}{
\index{can\_\-api@{can\_\-api}!CANIntUnregister@{CANIntUnregister}}
\index{CANIntUnregister@{CANIntUnregister}!can_api@{can\_\-api}}
\subsubsection[{CANIntUnregister}]{\setlength{\rightskip}{0pt plus 5cm}void CANIntUnregister (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga41087b2bf0f7088c85cb4ea0ca583169}
Unregisters an interrupt handler for the CAN controller.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the controller.\end{DoxyParams}
This function unregisters the previously registered interrupt handler and disables the interrupt on the interrupt controller.

\begin{DoxySeeAlso}{See also}
\hyperlink{group__interrupt__api_ga471d00d73ae22faa426c202f608e9c69}{IntRegister()} for important information about registering interrupt handlers.
\end{DoxySeeAlso}
\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga969a73040127206e121190d71385d538}{
\index{can\_\-api@{can\_\-api}!CANMessageClear@{CANMessageClear}}
\index{CANMessageClear@{CANMessageClear}!can_api@{can\_\-api}}
\subsubsection[{CANMessageClear}]{\setlength{\rightskip}{0pt plus 5cm}void CANMessageClear (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulObjID}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga969a73040127206e121190d71385d538}
Clears a message object so that it is no longer used.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulObjID}]is the message object number to disable (1-\/32).\end{DoxyParams}
This function frees the specified message object from use. Once a message object has been ``cleared,'' it will no longer automatically send or receive messages, or generate interrupts.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga0bdccdf3bb7f81c0a83150c37627be2a}{
\index{can\_\-api@{can\_\-api}!CANMessageGet@{CANMessageGet}}
\index{CANMessageGet@{CANMessageGet}!can_api@{can\_\-api}}
\subsubsection[{CANMessageGet}]{\setlength{\rightskip}{0pt plus 5cm}void CANMessageGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulObjID, }
\item[{{\bf tCANMsgObject} $\ast$}]{ pMsgObject, }
\item[{tBoolean}]{ bClrPendingInt}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga0bdccdf3bb7f81c0a83150c37627be2a}
Reads a CAN message from one of the message object buffers.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulObjID}]is the object number to read (1-\/32). \item[{\em pMsgObject}]points to a structure containing message object fields. \item[{\em bClrPendingInt}]indicates whether an associated interrupt should be cleared.\end{DoxyParams}
This function is used to read the contents of one of the 32 message objects in the CAN controller, and return it to the caller. The data returned is stored in the fields of the caller-\/supplied structure pointed to by {\itshape pMsgObject\/}. The data consists of all of the parts of a CAN message, plus some control and status information.

Normally this is used to read a message object that has received and stored a CAN message with a certain identifier. However, this could also be used to read the contents of a message object in order to load the fields of the structure in case only part of the structure needs to be changed from a previous setting.

When using CANMessageGet, all of the same fields of the structure are populated in the same way as when the \hyperlink{group__can__api_ga89c4fad5a3fcaf63d551312d4bd6559c}{CANMessageSet()} function is used, with the following exceptions:

{\itshape pMsgObject-\/$>$ulFlags:\/} 


\begin{DoxyItemize}
\item {\bfseries MSG\_\-OBJ\_\-NEW\_\-DATA} indicates if this is new data since the last time it was read
\item {\bfseries MSG\_\-OBJ\_\-DATA\_\-LOST} indicates that at least one message was received on this message object, and not read by the host before being overwritten.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga89c4fad5a3fcaf63d551312d4bd6559c}{
\index{can\_\-api@{can\_\-api}!CANMessageSet@{CANMessageSet}}
\index{CANMessageSet@{CANMessageSet}!can_api@{can\_\-api}}
\subsubsection[{CANMessageSet}]{\setlength{\rightskip}{0pt plus 5cm}void CANMessageSet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{unsigned long}]{ ulObjID, }
\item[{{\bf tCANMsgObject} $\ast$}]{ pMsgObject, }
\item[{{\bf tMsgObjType}}]{ eMsgType}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga89c4fad5a3fcaf63d551312d4bd6559c}
Configures a message object in the CAN controller.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em ulObjID}]is the object number to configure (1-\/32). \item[{\em pMsgObject}]is a pointer to a structure containing message object settings. \item[{\em eMsgType}]indicates the type of message for this object.\end{DoxyParams}
This function is used to configure any one of the 32 message objects in the CAN controller. A message object can be configured as any type of CAN message object as well as several options for automatic transmission and reception. This call also allows the message object to be configured to generate interrupts on completion of message receipt or transmission. The message object can also be configured with a filter/mask so that actions are only taken when a message that meets certain parameters is seen on the CAN bus.

The {\itshape eMsgType\/} parameter must be one of the following values:


\begin{DoxyItemize}
\item {\bfseries MSG\_\-OBJ\_\-TYPE\_\-TX} -\/ CAN transmit message object.
\item {\bfseries MSG\_\-OBJ\_\-TYPE\_\-TX\_\-REMOTE} -\/ CAN transmit remote request message object.
\item {\bfseries MSG\_\-OBJ\_\-TYPE\_\-RX} -\/ CAN receive message object.
\item {\bfseries MSG\_\-OBJ\_\-TYPE\_\-RX\_\-REMOTE} -\/ CAN receive remote request message object.
\item {\bfseries MSG\_\-OBJ\_\-TYPE\_\-RXTX\_\-REMOTE} -\/ CAN remote frame receive remote, then transmit message object.
\end{DoxyItemize}

The message object pointed to by {\itshape pMsgObject\/} must be populated by the caller, as follows:


\begin{DoxyItemize}
\item {\itshape ulMsgID\/} -\/ contains the message ID, either 11 or 29 bits.
\item {\itshape ulMsgIDMask\/} -\/ mask of bits from {\itshape ulMsgID\/} that must match if identifier filtering is enabled.
\item {\itshape ulFlags\/} 
\begin{DoxyItemize}
\item Set {\bfseries MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE} flag to enable interrupt on transmission.
\item Set {\bfseries MSG\_\-OBJ\_\-RX\_\-INT\_\-ENABLE} flag to enable interrupt on receipt.
\item Set {\bfseries MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER} flag to enable filtering based on the identifier mask specified by {\itshape ulMsgIDMask\/}.
\end{DoxyItemize}
\item {\itshape ulMsgLen\/} -\/ the number of bytes in the message data. This should be non-\/zero even for a remote frame; it should match the expected bytes of the data responding data frame.
\item {\itshape pucMsgData\/} -\/ points to a buffer containing up to 8 bytes of data for a data frame.
\end{DoxyItemize}

{\bfseries Example:} To send a data frame or remote frame(in response to a remote request), take the following steps:


\begin{DoxyEnumerate}
\item Set {\itshape eMsgType\/} to {\bfseries MSG\_\-OBJ\_\-TYPE\_\-TX}.
\item Set {\itshape pMsgObject-\/$>$ulMsgID\/} to the message ID.
\item Set {\itshape pMsgObject-\/$>$ulFlags\/}. Make sure to set {\bfseries MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE} to allow an interrupt to be generated when the message is sent.
\item Set {\itshape pMsgObject-\/$>$ulMsgLen\/} to the number of bytes in the data frame.
\item Set {\itshape pMsgObject-\/$>$pucMsgData\/} to point to an array containing the bytes to send in the message.
\item Call this function with {\itshape ulObjID\/} set to one of the 32 object buffers.
\end{DoxyEnumerate}

{\bfseries Example:} To receive a specific data frame, take the following steps:


\begin{DoxyEnumerate}
\item Set {\itshape eMsgObjType\/} to {\bfseries MSG\_\-OBJ\_\-TYPE\_\-RX}.
\item Set {\itshape pMsgObject-\/$>$ulMsgID\/} to the full message ID, or a partial mask to use partial ID matching.
\item Set {\itshape pMsgObject-\/$>$ulMsgIDMask\/} bits that should be used for masking during comparison.
\item Set {\itshape pMsgObject-\/$>$ulFlags\/} as follows:
\begin{DoxyItemize}
\item Set {\bfseries MSG\_\-OBJ\_\-TX\_\-INT\_\-ENABLE} flag to be interrupted when the data frame is received.
\item Set {\bfseries MSG\_\-OBJ\_\-USE\_\-ID\_\-FILTER} flag to enable identifier based filtering.
\end{DoxyItemize}
\item Set {\itshape pMsgObject-\/$>$ulMsgLen\/} to the number of bytes in the expected data frame.
\item The buffer pointed to by {\itshape pMsgObject-\/$>$pucMsgData\/} and {\itshape pMsgObject-\/$>$ulMsgLen\/} are not used by this call as no data is present at the time of the call.
\item Call this function with {\itshape ulObjID\/} set to one of the 32 object buffers.
\end{DoxyEnumerate}

If you specify a message object buffer that already contains a message definition, it will be overwritten.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga3693ab778af480c2d3089db6a551d558}{
\index{can\_\-api@{can\_\-api}!CANRetryGet@{CANRetryGet}}
\index{CANRetryGet@{CANRetryGet}!can_api@{can\_\-api}}
\subsubsection[{CANRetryGet}]{\setlength{\rightskip}{0pt plus 5cm}tBoolean CANRetryGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga3693ab778af480c2d3089db6a551d558}
Returns the current setting for automatic retransmission.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller.\end{DoxyParams}
Reads the current setting for the automatic retransmission in the CAN controller and returns it to the caller.

\begin{DoxyReturn}{Returns}
Returns {\bfseries true} if automatic retransmission is enabled, {\bfseries false} otherwise. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga2edf1770a8e6cafd206068dee0a33c92}{
\index{can\_\-api@{can\_\-api}!CANRetrySet@{CANRetrySet}}
\index{CANRetrySet@{CANRetrySet}!can_api@{can\_\-api}}
\subsubsection[{CANRetrySet}]{\setlength{\rightskip}{0pt plus 5cm}void CANRetrySet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{tBoolean}]{ bAutoRetry}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga2edf1770a8e6cafd206068dee0a33c92}
Sets the CAN controller automatic retransmission behavior.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em bAutoRetry}]enables automatic retransmission.\end{DoxyParams}
Enables or disables automatic retransmission of messages with detected errors. If {\itshape bAutoRetry\/} is {\bfseries true}, then automatic retransmission is enabled, otherwise it is disabled.

\begin{DoxyReturn}{Returns}
None. 
\end{DoxyReturn}
\hypertarget{group__can__api_ga9c212852faa05bed58d45af52e49b3fc}{
\index{can\_\-api@{can\_\-api}!CANStatusGet@{CANStatusGet}}
\index{CANStatusGet@{CANStatusGet}!can_api@{can\_\-api}}
\subsubsection[{CANStatusGet}]{\setlength{\rightskip}{0pt plus 5cm}unsigned long CANStatusGet (
\begin{DoxyParamCaption}
\item[{unsigned long}]{ ulBase, }
\item[{{\bf tCANStsReg}}]{ eStatusReg}
\end{DoxyParamCaption}
)}}
\label{group__can__api_ga9c212852faa05bed58d45af52e49b3fc}
Reads one of the controller status registers.


\begin{DoxyParams}{Parameters}
\item[{\em ulBase}]is the base address of the CAN controller. \item[{\em eStatusReg}]is the status register to read.\end{DoxyParams}
Reads a status register of the CAN controller and returns it to the caller. The different status registers are:


\begin{DoxyItemize}
\item {\bfseries CAN\_\-STS\_\-CONTROL} -\/ the main controller status
\item {\bfseries CAN\_\-STS\_\-TXREQUEST} -\/ bit mask of objects pending transmission
\item {\bfseries CAN\_\-STS\_\-NEWDAT} -\/ bit mask of objects with new data
\item {\bfseries CAN\_\-STS\_\-MSGVAL} -\/ bit mask of objects with valid configuration
\end{DoxyItemize}

When reading the main controller status register, a pending status interrupt will be cleared. This should be used in the interrupt handler for the CAN controller if the cause is a status interrupt. The controller status register fields are as follows:


\begin{DoxyItemize}
\item {\bfseries CAN\_\-STATUS\_\-BUS\_\-OFF} -\/ controller is in bus-\/off condition
\item {\bfseries CAN\_\-STATUS\_\-EWARN} -\/ an error counter has reached a limit of at least 96
\item {\bfseries CAN\_\-STATUS\_\-EPASS} -\/ CAN controller is in the error passive state
\item {\bfseries CAN\_\-STATUS\_\-RXOK} -\/ a message was received successfully (independent of any message filtering).
\item {\bfseries CAN\_\-STATUS\_\-TXOK} -\/ a message was successfully transmitted
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-MSK} -\/ mask of last error code bits (3 bits)
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-NONE} -\/ no error
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-STUFF} -\/ stuffing error detected
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-FORM} -\/ a format error occurred in the fixed format part of a message
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-ACK} -\/ a transmitted message was not acknowledged
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-BIT1} -\/ dominant level detected when trying to send in recessive mode
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-BIT0} -\/ recessive level detected when trying to send in dominant mode
\item {\bfseries CAN\_\-STATUS\_\-LEC\_\-CRC} -\/ CRC error in received message
\end{DoxyItemize}

The remaining status registers are 32-\/bit bit maps to the message objects. They can be used to quickly obtain information about the status of all the message objects without needing to query each one. They contain the following information:


\begin{DoxyItemize}
\item {\bfseries CAN\_\-STS\_\-TXREQUEST} -\/ if a message object's TxRequest bit is set, that means that a transmission is pending on that object. The application can use this to determine which objects are still waiting to send a message.
\item {\bfseries CAN\_\-STS\_\-NEWDAT} -\/ if a message object's NewDat bit is set, that means that a new message has been received in that object, and has not yet been picked up by the host application
\item {\bfseries CAN\_\-STS\_\-MSGVAL} -\/ if a message object's MsgVal bit is set, that means it has a valid configuration programmed. The host application can use this to determine which message objects are empty/unused.
\end{DoxyItemize}

\begin{DoxyReturn}{Returns}
Returns the value of the status register. 
\end{DoxyReturn}
